package com.itheima.genericityclass;

import java.util.Arrays;

public class Demo1 {
    public static void main(String[] args) {
        Box<String> b = new Box<>();
        b.setElement("定定定定");
        System.out.println(b.getElement());

        Box<Integer> a = new Box<>();
        a.setElement(520);
        System.out.println(a.getElement());

        Box<int[]> c = new Box<>();
        int[] arr = {1,2,3};
        c.setElement(arr);
        System.out.println(Arrays.toString(c.getElement()));
    }
}
class Box<E> {
    private E element;
    public Box() {
    }

    public Box(E element) {
        this.element = element;
    }

    public E getElement() {
        return element;
    }

    public void setElement(E element) {
        this.element = element;
    }
}